-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Test case and fix for NoSuchElementError in visibilityOf #3777 #3958
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
1 similar comment
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
1 similar comment
CLAs look good, thanks! |
Test is failing as it should |
… a race condition (#3777) Handle NoSuchElementError in the expected condition visibilityOf, which occurred when an element disappears between the isPresent() and isDisplayed() check.
Thanks for including a test case! |
…lements Expected conditions used `presenceOf` and `visibilityOf` to check that it's referencing elements which actually exist on the page, but there is a race condition with this strategy: an element could disappear after the `presenceOf`/`visibilityOf` check but before other checks, causing an error to be thrown. This PR handles this race condition in two ways: 1. `ElementFinder`'s `isEnabled`, `isDisplayed`, and `isSelected` functions now return false if no such element exists, rahter than throwing an error 2. `ExpectedConditions`'s `textToBePresent` and `textToBePresentInElementValue` now check for errors and also return false in those cases This is a general solution to the problem referenced in angular#3777 and angular#3958.
…lements Expected conditions used `presenceOf` and `visibilityOf` to check that it's referencing elements which actually exist on the page, but there is a race condition with this strategy: an element could disappear after the `presenceOf`/`visibilityOf` check but before other checks, causing an error to be thrown. This PR handles this race condition in two ways: 1. `ElementFinder`'s `isEnabled`, `isDisplayed`, and `isSelected` functions now return false if no such element exists, rahter than throwing an error 2. `ExpectedConditions`'s `textToBePresent` and `textToBePresentInElementValue` now check for errors and also return false in those cases This is a general solution to the problem referenced in angular#3777 and angular#3958.
Is this released yet? |
This fix went out in 5.1.0 |
Test case for #3777
I'll add the fix after a build failed to show the test case is correct.